<ToolBar x:Class="WozLib.UI.Controls.ToolSelectToolbar"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Margin="1" 
    x:Name="_ToolBar"
    >
  <ToolBar.Template>
    <ControlTemplate TargetType="{x:Type ToolBar}">
      <Border BorderBrush="Gray" BorderThickness="1" CornerRadius="5">
        <Border.Background>
          <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
            <LinearGradientBrush.GradientStops>
              <GradientStop Offset="0" Color="White" />
              <GradientStop Offset="1" Color="AliceBlue" />
            </LinearGradientBrush.GradientStops>
          </LinearGradientBrush>
        </Border.Background>
        <ItemsPresenter/>
      </Border>
    </ControlTemplate>
  </ToolBar.Template>
  <ToolBar.ItemsPanel>
    <ItemsPanelTemplate>
      <StackPanel Margin="2" Orientation="{Binding ElementName=_ToolBar, Path=Orientation}" />
    </ItemsPanelTemplate>
  </ToolBar.ItemsPanel>
  <ToolBar.Resources>
    <Style TargetType="RadioButton" x:Key="RadioButtonStyle">
      <Setter Property="HorizontalAlignment" Value="Left"/>
    </Style>
    <Style TargetType="{x:Type Canvas}">
      <Setter Property="Width" Value="12"/>
      <Setter Property="Height" Value="12"/>
      <Setter Property="Margin" Value="0 0 3 0"/>
    </Style>
  </ToolBar.Resources>

  <!--heading-->
  <TextBlock Margin="17 5 0 0" TextAlignment="Left" FontWeight="SemiBold">tools</TextBlock>


  <!--list of tools-->
  <RadioButton x:Name="_Selector_Checked" Checked="Selector_Checked" Style="{StaticResource RadioButtonStyle}">
    <Grid>
      <StackPanel Orientation="Horizontal">
        <Canvas>
          <Rectangle StrokeDashArray="2" Canvas.Top="2" Stroke="Black" Fill="Transparent" Width="12" Height="10"/>
        </Canvas>
        <TextBlock Text="selector"/>
      </StackPanel>
    </Grid>
  </RadioButton>
  <RadioButton x:Name="_Pencil_Checked" IsChecked="True" Checked="Pencil_Checked" Style="{StaticResource RadioButtonStyle}">
    <StackPanel Orientation="Horizontal">
      <Canvas>
        <Polygon Points="2,4 4,2 10,8 8,10" Stroke="Gray" Fill="Yellow" StrokeThickness="0.5">
          <!--<Polygon.Fill>
                  <RadialGradientBrush GradientOrigin="0,0" Center="0,0" RadiusX="1" RadiusY="1">
                    <RadialGradientBrush.GradientStops>
                      <GradientStop Color="AliceBlue" Offset="0" />
                      <GradientStop Color="Yellow" Offset="1" />
                    </RadialGradientBrush.GradientStops>
                  </RadialGradientBrush>
                </Polygon.Fill>-->
        </Polygon>
        <Polygon Points="8,10 10,8 12,12" Stroke="Black" Fill="Black" StrokeThickness="0.5"/>
        <Polygon Points="0,2 2,0 4,2 2,4" Stroke="Pink" Fill="Pink" StrokeThickness="0.5"/>
      </Canvas>
      <TextBlock Text="pencil"/>
    </StackPanel>
  </RadioButton>
  <RadioButton x:Name="_Eraser_Checked" Checked="Eraser_Checked" Style="{StaticResource RadioButtonStyle}">
    <StackPanel Orientation="Horizontal">
      <Canvas>
        <Polygon Points="0,0 6,0 12,8 6,8" Stroke="Gray" StrokeThickness="0.5">
          <Polygon.Fill>
            <RadialGradientBrush GradientOrigin="0,0" Center="0,0" RadiusX="1" RadiusY="1">
              <RadialGradientBrush.GradientStops>
                <GradientStop Color="AliceBlue" Offset="0" />
                <GradientStop Color="sc#1, 0.2725, 0.3353, 0.7882" Offset="1" />
              </RadialGradientBrush.GradientStops>
            </RadialGradientBrush>
          </Polygon.Fill>
        </Polygon>
        <Polygon Points="12,8 6,8 6,12 12,12" Stroke="Gray" Fill="sc#1, 0.2725, 0.3353, 0.7882" StrokeThickness="0.5"/>
        <Polygon Points="0,0 6,8 6,12 0,4" Stroke="Gray" StrokeThickness="0.5">
          <Polygon.Fill>
            <RadialGradientBrush GradientOrigin="0,0" Center="0,0" RadiusX="1" RadiusY="1">
              <RadialGradientBrush.GradientStops>
                <GradientStop Color="AliceBlue" Offset="0" />
                <GradientStop Color="sc#1, 0.2725, 0.3353, 0.7882" Offset="1" />
              </RadialGradientBrush.GradientStops>
            </RadialGradientBrush>
          </Polygon.Fill>
        </Polygon>
      </Canvas>
      <TextBlock Text="eraser"/>
    </StackPanel>
  </RadioButton>
  <RadioButton x:Name="_Line_Checked" Checked="Line_Checked" Style="{StaticResource RadioButtonStyle}">
    <StackPanel Orientation="Horizontal">
      <Canvas>
        <Line Stroke="Black" StrokeThickness="1.5" X1="2" X2="10" Y1="2" Y2="10"/>
      </Canvas>
      <TextBlock Text="line"/>
    </StackPanel>
  </RadioButton>
  <RadioButton x:Name="_Rectangle_Checked" Checked="Rectangle_Checked" Style="{StaticResource RadioButtonStyle}">
    <StackPanel Orientation="Horizontal">
      <Canvas>
        <Rectangle Canvas.Top="2" Stroke="Black" Fill="sc#1, 0.2725, 0.3353, 0.7882" Width="12" Height="10"/>
      </Canvas>
      <TextBlock Text="rectangle"/>
    </StackPanel>
  </RadioButton>
  <RadioButton x:Name="_Ellipse_Checked" Checked="Ellipse_Checked" Style="{StaticResource RadioButtonStyle}">
    <StackPanel Orientation="Horizontal">
      <Canvas>
        <Ellipse Canvas.Top="2" Stroke="Black" Fill="sc#1, 0.2725, 0.3353, 0.7882" Width="12" Height="10"/>
      </Canvas>
      <TextBlock Text="ellipse"/>
    </StackPanel>
  </RadioButton>
  <RadioButton x:Name="_Image_Checked" Checked="Image_Checked" Style="{StaticResource RadioButtonStyle}">
    <StackPanel Orientation="Horizontal">
      <Canvas ClipToBounds="True">
        <Rectangle Fill="SkyBlue" Height="8" Width="12"/>
        <Rectangle Fill="Green" Height="4" Width="12" Canvas.Top="8"/>
        <Ellipse Fill="Yellow" Height="8" Width="8" Canvas.Left="7" Canvas.Top="-3"/>
        <Polygon Fill="SlateGray" Points="0,8 3,2 5,7, 7,5 9,8"/>
        <Rectangle Fill="Transparent" Height="12" Width="12" Stroke="Gray" StrokeThickness="0.5"/>
      </Canvas>
      <TextBlock Text="image"/>
    </StackPanel>
  </RadioButton>
  <RadioButton x:Name="_Gradient_Checked" Checked="Gradient_Checked" Style="{StaticResource RadioButtonStyle}">
    <StackPanel Orientation="Horizontal">
      <Canvas>
        <Rectangle Canvas.Top="2" Stroke="Black" Width="12" Height="10">
          <Rectangle.Fill>
            <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
              <GradientStop Color="AliceBlue" Offset="0"/>
              <GradientStop Color="sc#1, 0.2725, 0.3353, 0.7882" Offset="1"/>
            </LinearGradientBrush>
          </Rectangle.Fill>
        </Rectangle>
      </Canvas>
      <TextBlock Text="gradient"/>
    </StackPanel>
  </RadioButton>
  <RadioButton x:Name="_Text_Checked" Checked="Text_Checked" Style="{StaticResource RadioButtonStyle}">
    <StackPanel Orientation="Horizontal">
      <Canvas>
        <Rectangle Canvas.Top="2" StrokeThickness="0" Width="12" Height="10">
          <Rectangle.Fill>
            <VisualBrush Stretch="None" AlignmentX="Left" AlignmentY="Top">
              <VisualBrush.Visual>
                <TextBox Text="Aaaa" FontSize="8" Padding="0"/>
              </VisualBrush.Visual>
            </VisualBrush>
          </Rectangle.Fill>
        </Rectangle>
      </Canvas>
      <TextBlock Text="textbox"/>
    </StackPanel>
  </RadioButton>
  <RadioButton x:Name="_Button_Checked" Checked="Button_Checked" Style="{StaticResource RadioButtonStyle}">
    <StackPanel Orientation="Horizontal">
      <Canvas>
        <Rectangle Canvas.Top="2" StrokeThickness="0" Width="12" Height="10">
          <Rectangle.Fill>
            <VisualBrush>
              <VisualBrush.Visual>
                <Button Width="20" Height="12"/>
              </VisualBrush.Visual>
            </VisualBrush>
          </Rectangle.Fill>
        </Rectangle>
      </Canvas>
      <TextBlock Text="button"/>
    </StackPanel>
  </RadioButton>
  <RadioButton Visibility="Collapsed" x:Name="_Arrow_Checked" Checked="Arrow_Checked" Style="{StaticResource RadioButtonStyle}">
    <StackPanel Orientation="Horizontal">
      <Canvas>
      </Canvas>
      <TextBlock Text="arrow"/>
    </StackPanel>
  </RadioButton>

  <RadioButton Visibility="Collapsed" x:Name="_Gesture_Checked" Checked="Gesture_Checked" Style="{StaticResource RadioButtonStyle}">
    <StackPanel Orientation="Horizontal">
      <Canvas>
        <Path Data="M 1,11 C 15,4 8,0 2,4 C 3,11 11,11 11,11" Stroke="sc#1, 0.1725, 0.2353, 0.6882" StrokeThickness="1" StrokeDashArray="2 1"/>
      </Canvas>
      <TextBlock Text="gesture"/>
    </StackPanel>
  </RadioButton>

  <RadioButton Visibility="Visible" x:Name="_Link_Checked" Checked="Link_Checked" Style="{StaticResource RadioButtonStyle}">
    <StackPanel Orientation="Horizontal">
      <Canvas>
      </Canvas>
      <TextBlock Text="link"/>
    </StackPanel>
  </RadioButton>

  <RadioButton Visibility="Collapsed" x:Name="_None_Checked" Checked="None_Checked" Style="{StaticResource RadioButtonStyle}">
    <StackPanel Orientation="Horizontal">
      <Canvas>
      </Canvas>
      <TextBlock Text="none"/>
    </StackPanel>
  </RadioButton>
</ToolBar>
